#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main()
{
	int n, t, c;
	cin>>n>>t>>c;

	vector<int> vi;
	for (int i = 0; i < n; ++i)
	{
		int tmp;
		cin>>tmp;
		vi.push_back(tmp);
	}

	int ret = 0;
	int prev = 0;
	int pos = 0;
	while (pos < n && vi[pos] > t)
		++pos;

	if (pos == n)
	{
		cout<<0<<endl;
		return 0;
	}

	prev = pos;
	while (pos < n)
	{
		while (pos < n && vi[pos] <= t)
			++pos;

		if (pos == n) break;

		if (pos - prev >= c)
			ret += pos - prev - c + 1;

		while (pos < n && vi[pos] > t)
			++pos;

		prev = pos;
	}

	if (prev < n && (pos-prev) >= c)
		ret += pos - prev - c + 1;

	cout<<ret<<endl;
}